#@layout()
#define main()
<div id="image"></div>
<input type="submit" value="打印" onclick="printpage()">

<script language="javascript">
function printpage()
  {
  window.print();
  }
</script>

<input type="hidden" class="layui-input" id="orderId" name="order.orderId" value="#(order.order_id??)"/>
<div class="layui-row layui-col-space1 task-row">
    #@colStart("供应商",6)
    <input type="text" class="layui-input" name="order.supplierId" value="#(order.supplier_id??)" readonly/>
    #@colEnd()
    #@colStart("起单人",6)
    <input type="text" lay-verType='tips'class="layui-input" name="order.originator" value="#(order.originator??)" readonly/>
    #@colEnd()
</div>
<div class="layui-row layui-col-space1 task-row">
    #@colStart("经手人",6)
    <input type="text" lay-verType='tips' class="layui-input" name="order.hander" value="#(order.hander??)" readonly/>
    #@colEnd()
    #@colStart("确认人",6)
    <input type="text" lay-verType='tips' class="layui-input" name="order.confirmer" value="#(order.confirmer??)" readonly/>
    #@colEnd()
</div>
<div class="layui-row layui-col-space1 task-row">
    #@colStart("起单时间",6)
    <input type="text" lay-verType='tips' class="layui-input" name="order.originatTime" value="#(order.originat_time??)" readonly/>
    #@colEnd()
    #@colStart("计划到货时间",6)
    <input type="text" lay-verType='tips' class="layui-input" name="order.planTime" value="#(order.plan_time??)" readonly/>
    #@colEnd()
</div>
<div class="layui-row layui-col-space1 task-row">
    #@colStart("实际到货时间",6)
    <input type="text" lay-verType='tips' class="layui-input" name="order.actualTime" value="#(order.actual_time??)" readonly/>
    #@colEnd()
    #@colStart("结账方式",6)
    <input type="text" lay-verType='tips' class="layui-input" name="order.settleWay" value="#(order.settle_way??)" readonly/>
    #@colEnd()
</div>
<div class="layui-row layui-col-space1 task-row">
    #@colStart("总计金额",6)
    <input type="text" lay-verType='tips' class="layui-input" name="order.totalAmount" value="#(order.total_amount??)" readonly/>
    #@colEnd()
    #@colStart("是否含税",6)
    <input type="text" lay-verType='tips' class="layui-input" name="order.containBill" value="#(order.contain_bill??)" readonly/>
    #@colEnd()
</div>
<div class="layui-row layui-col-space1 task-row">
    #@colStart("税率",6)
    <input type="text" lay-verType='tips' class="layui-input" name="order.taxRate" value="#(order.tax_rate??)" readonly/>
    #@colEnd()
    #@colStart("单据状态",6)
    <input type="text" lay-verType='tips' class="layui-input" name="order.status" value="#(order.status??)" readonly/>
    #@colEnd()
</div>

<!-- 表格列表 -->
<div class="layui-row  f-index-toolbar">
    <div class="layui-col-xs12">
        <table id="maingrid" lay-filter="maingrid"></table>
    </div>
</div>

<!-- 表格列表 -->
<div class="layui-row  f-index-toolbar">
    <div class="layui-col-xs12">
        <table id="maingrid2" lay-filter="maingrid"></table>
    </div>
</div>

#end

#define js()
<script>
    gridArgs.title='订单明细';
    gridArgs.dataId='detail_id';
    gridArgs.deleteUrl='#(path)/portal/form/business/delete?object=sys_tree&primaryKey='+gridArgs.dataId;
    gridArgs.updateUrl='#(path)/portal/form/business/edit?viewCode=view_update&id=';
    gridArgs.addUrl='#(path)/erp/order/purchaseDetail/add';
    gridArgs.gridDivId ='maingrid';
    initGrid({id : 'maingrid2'
        ,elem : '#maingrid2'
        ,cellMinWidth: 80
        ,cols : [ [
            {title: '主键',field : 'detail_id',width : 35,checkbox : true},
            {title: '序号',type:'numbers',width:35},
            {title: '物品', field: 'entity_id' },
            {title: '所属上级', field: 'par_entity'},
            {title: '计量单位', field: 'unit'},
            {title: '数量', field: 'amount'},
            {title: '价格', field: 'price'},
            {title: '折扣', field: 'discount'},
            {title: '金额', field: 'sum_money'},
        ] ]
        ,url:'#(path)/erp/order/purchaseDetail/list?orderId='+$("#orderId").val()
        ,where:{"object":"sys_tree","primaryKey":gridArgs.dataId}
        ,searchForm : 'searchForm'
    });

    gridArgs.title='付款明细';
    gridArgs.dataId='detail_id';
    gridArgs.deleteUrl='#(path)/portal/form/business/delete?object=sys_tree&primaryKey='+gridArgs.dataId;
    gridArgs.updateUrl='#(path)/portal/form/business/edit?viewCode=view_update&id=';
    gridArgs.addUrl='#(path)/erp/order/purchaseDetail/add';
    gridArgs.gridDivId ='maingrid';
    initGrid({id : 'maingrid'
        ,elem : '#maingrid'
        ,cellMinWidth: 80
        ,cols : [ [
            {title: '主键',field : 'detail_id',width : 35,checkbox : true},
            {title: '序号',type:'numbers',width:35},
            {title: '支付编码', field: 'pay_code' },
            {title: '支付金额', field: 'sum_money'},
            {title: '支付方', field: 'pay_men'},
            {title: '收入方', field: 'receive_men'},
            {title: '交易时间', field: 'trans_time'},
        ] ]
        ,url:'#(path)/erp/order/outcomeDetail/list?orderId='+$("#orderId").val()
        ,where:{"object":"sys_tree","primaryKey":gridArgs.dataId}
        ,searchForm : 'searchForm'
    });
</script>

#end